/**
 * Copyright 2014  XCL-Charts
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @Project XCL-Charts
 * @Description Android图表基类库
 * @author XiongChuanLiang<br></br>(xcl_168@aliyun.com)
 * @license http://www.apache.org/licenses/  Apache v2 License
 * @version 1.0
 */
package com.gitee.wsl.common.chart.sample.line.model


import android.graphics.Paint
import com.gitee.wsl.api.SelectAbleItem
import com.gitee.wsl.common.chart.render.foreground.info.PlotLabel
import com.gitee.wsl.common.chart.render.shape.line.PlotLine
import com.gitee.wsl.common.ui.draw.type.LineSpacingStyle


/**
 * @ClassName BaseLineData
 * @Description 线图(曲线图  折线图 面积图)数据基类
 * @author XiongChuanLiang<br></br>(xcl_168@aliyun.com)
 */
open class BaseLineData() : SelectAbleItem{

    override var isSelected: Boolean=false

    //标签轴用的到值
    var label: String =""

    //是否在点上显示标签
    var isLabelVisible = false

    //线的基类
    var plotLine: PlotLine = PlotLine()

    //线的类型
    var lineSpacingStyle = LineSpacingStyle.Solid

    //用于设置标签特性
    val plotLabel: PlotLabel by lazy{
        PlotLabel()
    }

    //标签文字旋转角度
    var itemLabelRotateAngle = 0.0f

    /**
     * 开放交叉点的半径,用来决定绘制的点的图形的大小
     * @param radius 半径
     */
    fun setDotRadius(radius: Float) {
        plotLine.plotDot.dotRadius = radius
    }

    var dotStyle by plotLine::dotStyle

    var lineColor:Int by plotLine.linePaint::color

    val dotLinePaint:Paint
       get() = plotLine.linePaint

    val dotLabelPaint:Paint by plotLine::dotLabelPaint
}